package com.zhongke.cotrun.service.impl;

import com.zhongke.cotrun.mapper.IntegralOfTypeMapper;
import com.zhongke.cotrun.model.pojo.IntegralOfType;
import com.zhongke.cotrun.service.IntegralOfTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class IntegralOfTypeServiceImpl implements IntegralOfTypeService {



    @Autowired
    IntegralOfTypeMapper integralOfTypeMapper;

    /**
     * 新建积分所属类型
     * @param integralOfType
     * @return
     */
    @Override
    public boolean insertIntegralOfType(IntegralOfType integralOfType) {
        return integralOfTypeMapper.insertIntegralOfType(integralOfType);
    }

    /**
     * 根据级别查询所有的
     * @param rank
     * @return
     */
    @Override
    public List<IntegralOfType> selectIntegralOfType(Integer rank) {
        return integralOfTypeMapper.selectIntegralOfType(rank);
    }

    /**
     * 根据code值查询积分所属类别
     * @param code
     * @return
     */
    @Override
    public IntegralOfType selectIntegralOfTypeByCode(Integer code) {
        return integralOfTypeMapper.selectIntegralOfTypeByCode(code);
    }
}
